<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>查单词</title>
	</head>
	<body>
		<input id="pwd" placeholder="请您输入英文" />
		<input type="button" value="查询" onclick="SearchWord()" />
		<script>
		var chineses = ["猪","狗","猫"];
		var english = ["pig","dog","cat"];
		var SearchWord = function(){
			var word = pwd.value;
			var isFind = false;
			for(var i=0;i<english.length;i++){
				if(english[i] == word){
					alert(chineses[i]);
					isFind = true;
				}
			}
			for(var i=0;i<chineses.length;i++){
				if(chineses[i] == word){
					alert(english[i]);
					isFind = true;
				}
			}
			if(!isFind){
				alert("没有该单词！");
			}
		};
		</script>
		
	</body>
</html>
